<?php

use yii\db\Migration;

/**
 * Class m180107_151038_alter_project_investigation_file
 */
class m180107_151038_alter_project_investigation_file extends Migration
{
    /**
     * @inheritdoc
     */
    public function safeUp()
    {
        $this->alterColumn('project_investigation_file', 'download_count', $this->smallInteger()->defaultValue(0)->comment('下载次数'));
        $this->alterColumn('project_investigation_file', 'category', $this->smallInteger()->defaultValue(0)->comment('类别'));

        $this->addColumn('project_investigation_stakeholder', 'file_name', $this->string()->comment('新文件名 '));
        $this->addColumn('project_investigation_stakeholder', 'state', $this->smallInteger()->defaultValue(1)->comment('是否标注红旗，1是，2否'));
    }

    /**
     * @inheritdoc
     */
    public function safeDown()
    {
        echo "m180107_151038_alter_project_investigation_file cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m180107_151038_alter_project_investigation_file cannot be reverted.\n";

        return false;
    }
    */
}
